package com.shiguiwu.springmybatis.spring.imports.demo;

import com.shiguiwu.springmybatis.spring.imports.demo.annotation.EnableMethodCostTime;
import com.shiguiwu.springmybatis.spring.imports.demo.service.AService;
import com.shiguiwu.springmybatis.spring.imports.demo.service.BService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * @description: 计算时间，含有service的类名
 * @author: stone
 * @date: Created by 2021/9/29 17:18
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.imports.demo
 */
@ComponentScan
//去掉之后就不在有拦截方法，实现方法耗时的功能
@EnableMethodCostTime
public class ImportDemoTests {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ImportDemoTests.class);
        System.out.println(context.getClass().getName());

        AService bean = context.getBean(AService.class);
        BService bean1 = context.getBean(BService.class);
        bean.mA();
        bean1.mB();
    }
}
